﻿namespace PlaylistCopy.Logging
{
    using NLog;
    using PlaylistCopy.Contract;
    using System;

    public class PlaylistCopyLogger : ILogger
    {
        private readonly Logger nLogger;

        public PlaylistCopyLogger(string name)
        {
            this.nLogger = LogManager.GetLogger(name);
        }

        public void Error(string message, params object[] args)
        {
            this.nLogger.Error(string.Format(message, args));
        }

        public void ErrorException(string message, Exception exception)
        {
            this.nLogger.Error(message, exception);
        }

        public void ErrorException(Exception exception, string message, params object[] args)
        {
            this.nLogger.Error(string.Format(message, args), exception);
        }

        public void Warning(string message, params object[] args)
        {
            this.nLogger.Warn(string.Format(message, args));
        }

        public void WarningException(string message, Exception exception)
        {
            this.nLogger.Warn(message, exception);
        }

        public void WarningException(Exception exception, string message, params object[] args)
        {
            this.nLogger.Warn(string.Format(message, args), exception);
        }

        public void Info(string message, params object[] args)
        {
            this.nLogger.Info(string.Format(message, args));
        }

        public void InfoException(string message, Exception exception)
        {
            this.nLogger.Info(message, exception);
        }

        public void InfoException(Exception exception, string message, params object[] args)
        {
            this.nLogger.Info(string.Format(message, args), exception);
        }
    }
}
